package com.sz.springboot_jpa.cntroller;

import com.sz.springboot_jpa.entity.User;
import com.sz.springboot_jpa.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@Controller
@RequestMapping("u")
public class UserController {


    @Resource
    private UserService userService;

    /**
     * 注册用户
     * @param user
     * @return
     */
    @RequestMapping("reg")
    public String reg(User user){
        userService.reg(user);
        return "ok";
    }
}
